<?php
// [ 应用入口文件 ]
namespace think;

header('Access-Control-Allow-Origin: *');
header('Access-Control-Max-Age: 1800');
header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE');
header('Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-CSRF-TOKEN, X-Requested-With,token');
		
require __DIR__ . '/../vendor/autoload.php';

// 检测PHP环境
if(version_compare(PHP_VERSION,'7.1.0','<'))  die('PHP版本过低，最少需要PHP7.1.0，请升级PHP版本！');

//定义系统版本
require __DIR__ . '/../version.php';

$http = (new  App())->http;

// 检测程序安装
if(!is_file(__DIR__ . '/install.lock')){
    $response = $http->name('install')->run();
}else{
    $response = $http->run();
}


// 执行HTTP应用并响应
$response->send();
$http->end($response);
